{include file="public/header" /}



<div class="page">
    <div class="fixed-bar">
        <div class="item-title">
            <div class="subject">
                <h3>优惠劵赠送记录</h3>
                <h5></h5>
            </div>
            {include file="public/admin_items" /}
        </div>
    </div>
    <form method="get" name="formSearch" id="formSearch">
        <div class="ds-search-form">
            <dl>
                <dt>领取人：</dt>
                <dd><input type="text" value="{$Request.param.member_name}" name="member_name" id="member_name" class="txt"></dd>
            </dl>
            <dl>
                <dt>优惠劵名称：</dt>
                <dd><input type="text" value="{$Request.param.name}" name="name" id="name" class="txt"></dd>
            </dl>
            <dl>
                <dt>优惠券发放条件：</dt>
                <dd>
                    <select name="state">
                        <option value="" selected>{$Think.lang.ds_please_choose}</option>
                        <option value="1"
                                {eq name="Request.get.state" value="1" }selected {/eq}>新用户注册首次登录赠送</option>
                        <option value="2" {eq name="Request.get.state" value="2" }selected {/eq}>定时发放</option>
                        <option value="3" {eq name="Request.get.state" value="3" }selected {/eq}>下单满多少赠送</option>
                    </select>
                </dd>
            </dl>
            <div class="btn_group">
                <input type="submit" class="btn" value="{$Think.lang.ds_search}">
                {if $name !='' || $state !='' || $member_name != ''}
                <a style="margin-top: -51px;margin-left: 82px;" href="{:url('Vouchersend/index')}" class="btn btn-default" title="{$Think.lang.ds_cancel}">{$Think.lang.ds_cancel}</a>
                {/if}
            </div>
        </div>
    </form>


    <table class="ds-default-table">
        <thead>
            <tr class="thead">
                <th class="w24">序号</th>
                <th class="align-center"><span>优惠劵名称</span></th>
                <th class="align-center"><span>优惠劵类型</span></th>
                <th class="align-center"><span>优惠劵领取模式</span></th>
                <th class="align-center"><span>领取人</span></th>
                <th class="align-center"><span>领取时间</span></th>
                <th class="align-center"><span>到期时间</span></th>
                <th class="align-center"><span>使用时间</span></th>
                <th class="align-center"><span>使用状态</span></th>
                <th class="align-center w100"><span>{$Think.lang.ds_handle}</span></th>
            </tr>
        </thead>
        <tbody>
            {notempty name="vouchertype_list"}
            {foreach name="vouchertype_list" item="val" key="k" }
             <tr class="hover">
                <td><?php echo $k+1; ?></td>
                <td class="align-center">
                    <span>
                    {$val.voucher_title}
                    </span>
                </td>
                <td class="align-center">
                    <span>
                    {if condition="($val.vou_type==1)"}商城
                    {elseif condition="($val.vou_type==2)"}服务
                    {elseif condition="($val.vou_type==3)"}项目
                    {/if}
                    </span>
                </td>

                <td class="align-center">
                    <span>
                    {if condition="($val.voucher_type_id==1)"}新用户注册首次登录赠送
                    {elseif condition="($val.voucher_type_id==2)"}定时发放
                    {elseif condition="($val.voucher_type_id==3)"}下单满多少赠送
                    {/if}
                    </span>
                </td>
                <td class="align-center">
                    {$val.member_name}
                </td>
                <td class="align-center">
                    <span>
                        {$val.create_time|date="Y-m-d H:i:s",###}
                    </span>
                </td>
                <td class="align-center">
                    <span>
                        {$val.due_time|date="Y-m-d H:i:s",###}
                    </span>
                </td>
                <td class="align-center">
                    <span>
                        <?php if(empty($val['used_time'])) {?>
                          
                        <?php }else{?>
                        {$val.used_time|date="Y-m-d H:i:s",###}
                        <?php  }?>
                    </span>
                </td>
                <td class="align-center">
                    <span>
                    {if condition="($val.is_used==1)"}未使用
                    {elseif condition="($val.is_used==2)"}已使用
                    {/if}
                    </span>
                </td>
                <td class="nowrap align-center">
<!--                     <a href="{:url('Voucher/priceedit',['id'=>$val.id])}" class="dsui-btn-edit"><i
                            class="iconfont"></i>{$Think.lang.ds_edit}</a> -->
                    <a href="javascript:void(0);"
                       onclick="ds_ajaxget_confirm('{:url('Vouchersend/drop',['id'=>$val.id])}','确定要操作删除吗？');"
                       class="dsui-btn-del"><i class="iconfont"></i>删除</a>

                </td>
            </tr>
            {/foreach}
            {else /}
            <tr class="no_data">
                <td colspan="15">{$Think.lang.ds_no_record}</td>
            </tr>
            {/notempty}
        </tbody>
    </table>
    {$show_page}
</div>
<script type="text/javascript" src="{$Think.ADMIN_SITE_ROOT}/js/jquery.edit.js" charset="utf-8"></script>
<script language="javascript">
    $(function () {
        $('#sdate').datepicker({dateFormat: 'yy-mm-dd'});
        $('#edate').datepicker({dateFormat: 'yy-mm-dd'});
    });

    //查看详情
    function voucher_setting_info(ids_str) {
        _uri = ADMINSITEURL + "/Vouchertype/voucher_type_info?id=" + ids_str;
        dsLayerOpen(_uri, '查看详情', '800px', '500px');
    }
</script>